1 package uba.db.sql.language;
2
3 import org.apache.commons.lang.builder.EqualsBuilder;
4 import org.apache.commons.lang.builder.HashCodeBuilder;
5
6 /***
7 * Representa un "selection source" que es el resultado de hacer un JOIN entre
8 * dos selection sources.
9 *
10 * @version $Revision: 1.3 $
11 */
12 public class Join implements SelectionSource {
13 private SelectionSource left;
14 private SelectionSource right;
15
16 /***
17 * Crea un join de dos selection sources.
18 *
19 * @param left
20 * un selection source
21 * @param right
22 * otro selection source
23 */
24 public Join(SelectionSource left, SelectionSource right) {
25 this.left = left;
26 this.right = right;
27 }
28
29 public SelectionSource left() {
30 return left;
31 }
32
33 public SelectionSource right() {
34 return right;
35 }
36
37 /***
38 * @see uba.db.sql.language.Visitable#accept(uba.db.sql.language.Visitor)
39 */
40 public void accept(Visitor visitor) {
41 visitor.visitJoin(this);
42 }
43
44 /***
45 * @see java.lang.Object#equals(java.lang.Object)
46 */
47 public boolean equals(Object obj) {
48 return EqualsBuilder.reflectionEquals(this, obj);
49 }
50
51 /***
52 * @see java.lang.Object#hashCode()
53 */
54 public int hashCode() {
55 return HashCodeBuilder.reflectionHashCode(this);
56 }
57
58 /***
59 * @see java.lang.Object#toString()
60 */
61 public String toString() {
62 return left.toString() + ", " + right.toString();
63 }
64 }